<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: random.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a03641.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">kernel/random.c 文件参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="a03629_source.html">precomp.h</a>&quot;</code><br />
</div>
<p><a href="a03641_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:ac2c47e39bdf2dc77fcb12369b78b5271"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#ac2c47e39bdf2dc77fcb12369b78b5271">SetWindowState</a> (<a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwnd, <a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwFlags)</td></tr>
<tr class="separator:ac2c47e39bdf2dc77fcb12369b78b5271"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e68b01f3252ff9f8fb087f944f464cc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#a1e68b01f3252ff9f8fb087f944f464cc">ClearWindowState</a> (<a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwnd, <a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwFlags)</td></tr>
<tr class="separator:a1e68b01f3252ff9f8fb087f944f464cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae14a3eceb7409023940af5be90761a68"><td class="memItemLeft" align="right" valign="top">HRGN&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#ae14a3eceb7409023940af5be90761a68">SaveClipRgn</a> (HDC hdc)</td></tr>
<tr class="separator:ae14a3eceb7409023940af5be90761a68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedc29edf0e324a74e237f3203685bb92"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#aedc29edf0e324a74e237f3203685bb92">RestoreClipRgn</a> (HDC hdc, HRGN hrgnRestore)</td></tr>
<tr class="separator:aedc29edf0e324a74e237f3203685bb92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab30158d9de22f52e0dbe98db97b94e62"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a> (<a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwnd, <a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwndFilter)</td></tr>
<tr class="separator:ab30158d9de22f52e0dbe98db97b94e62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65561e3afb58680ed8f6ef29adbb2a24"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#a65561e3afb58680ed8f6ef29adbb2a24">AllocateUnicodeString</a> (PUNICODE_STRING pstrDst, PUNICODE_STRING pstrSrc)</td></tr>
<tr class="separator:a65561e3afb58680ed8f6ef29adbb2a24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4eefb8731d329797cc990e68b5cd02ba"><td class="memItemLeft" align="right" valign="top">HBRUSH&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#a4eefb8731d329797cc990e68b5cd02ba">xxxGetControlColor</a> (<a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwndParent, <a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwndCtl, HDC hdc, <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message)</td></tr>
<tr class="separator:a4eefb8731d329797cc990e68b5cd02ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9654ab2c4ceb1fdd5cae23a67e88f0cd"><td class="memItemLeft" align="right" valign="top">HBRUSH&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#a9654ab2c4ceb1fdd5cae23a67e88f0cd">xxxGetControlBrush</a> (<a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a> pwnd, HDC hdc, <a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message)</td></tr>
<tr class="separator:a9654ab2c4ceb1fdd5cae23a67e88f0cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3944c84592d9a24ff67d4bb2ae73d51"><td class="memItemLeft" align="right" valign="top">BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03641.html#aa3944c84592d9a24ff67d4bb2ae73d51">HardErrorControl</a> (<a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwCmd, HDESK hdeskRestore)</td></tr>
<tr class="separator:aa3944c84592d9a24ff67d4bb2ae73d51"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">函数说明</h2>
<a id="a65561e3afb58680ed8f6ef29adbb2a24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65561e3afb58680ed8f6ef29adbb2a24">&#9670;&nbsp;</a></span>AllocateUnicodeString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL AllocateUnicodeString </td>
          <td>(</td>
          <td class="paramtype">PUNICODE_STRING&#160;</td>
          <td class="paramname"><em>pstrDst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUNICODE_STRING&#160;</td>
          <td class="paramname"><em>pstrSrc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00123">123</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;{</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordflow">if</span> (pstrSrc == NULL) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        RtlInitUnicodeString(pstrDst, NULL);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    }</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    pstrDst-&gt;Buffer = UserAllocPoolWithQuota(pstrSrc-&gt;MaximumLength, TAG_TEXT);</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">if</span> (pstrDst-&gt;Buffer == NULL) {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        RtlCopyMemory(pstrDst-&gt;Buffer, pstrSrc-&gt;Buffer, pstrSrc-&gt;MaximumLength);</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        UserFreePool(pstrDst-&gt;Buffer);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        pstrDst-&gt;Buffer = NULL;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    pstrDst-&gt;MaximumLength = pstrSrc-&gt;MaximumLength;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    pstrDst-&gt;Length = pstrSrc-&gt;Length;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">被这些函数引用 <a class="el" href="a03173_source.html#l00321">_SetCursorIconData()</a>, <a class="el" href="a00623_source.html#l00211">InternalRegisterClassEx()</a> , 以及 <a class="el" href="a00623_source.html#l01211">xxxSetClassData()</a>.</p>

</div>
</div>
<a id="ab30158d9de22f52e0dbe98db97b94e62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab30158d9de22f52e0dbe98db97b94e62">&#9670;&nbsp;</a></span>CheckPwndFilter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL CheckPwndFilter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwndFilter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00100">100</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;{</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordflow">if</span> ((pwndFilter == NULL) || (pwndFilter == pwnd) ||</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            ((pwndFilter == (<a class="code" href="a02581.html">PWND</a>)1) &amp;&amp; (pwnd == NULL))) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="a00365.html#ac6d261d53f1b8bdcd4467f5bc1072066">_IsChild</a>(pwndFilter, pwnd);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a03752_source.html#l00658">_IsChild()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a00812_source.html#l00548">DoPaint()</a>, <a class="el" href="a00887_source.html#l00511">DoTimer()</a>, <a class="el" href="a00824_source.html#l02437">FindQMsg()</a>, <a class="el" href="a03290_source.html#l03275">xxxScanSysQueue()</a> , 以及 <a class="el" href="a00923_source.html#l00227">xxxWindowHitTest2()</a>.</p>

</div>
</div>
<a id="a1e68b01f3252ff9f8fb087f944f464cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e68b01f3252ff9f8fb087f944f464cc">&#9670;&nbsp;</a></span>ClearWindowState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ClearWindowState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>dwFlags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00032">32</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;{</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    ClrWF(pwnd, dwFlags);</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa3944c84592d9a24ff67d4bb2ae73d51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3944c84592d9a24ff67d4bb2ae73d51">&#9670;&nbsp;</a></span>HardErrorControl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BOOL HardErrorControl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>dwCmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HDESK&#160;</td>
          <td class="paramname"><em>hdeskRestore</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00243">243</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;{</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdesk;</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdeskRestore;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    PUNICODE_STRING pstrName;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    MSG msg;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="keywordflow">switch</span> (dwCmd) {</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="keywordflow">case</span> HardErrorSetup:</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160; </div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="comment">         * Don&#39;t do it if the system has not been initialized.</span></div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a> == NULL) {</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;HardErrorControl: System not initialized&quot;</span>);</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160; </div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;<span class="comment">         * Setup caller as the hard error handler.</span></div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> != NULL) {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;            <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;HardErrorControl: pti not NULL %lX&quot;</span>, <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a>);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        }</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160; </div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;<span class="comment">         * Mark the handler as active.</span></div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = pti;</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;<span class="comment">         * Clear any pending quits.</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> = 0;</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="keywordflow">case</span> HardErrorCleanup:</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<span class="comment">         * Remove caller as the hard error handler.</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> != pti)</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = NULL;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160; </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <span class="keywordflow">case</span> HardErrorAttachUser:</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160; </div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;<span class="comment">         * Only attach to a user desktop.</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        pstrName = POBJECT_NAME(<a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <span class="keywordflow">if</span> (pstrName &amp;&amp; (!_wcsicmp(TEXT(<span class="stringliteral">&quot;Winlogon&quot;</span>), pstrName-&gt;Buffer) ||</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;                !_wcsicmp(TEXT(<span class="stringliteral">&quot;Screen-saver&quot;</span>), pstrName-&gt;Buffer))) {</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;            <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_ACCESS_DENIED, <a class="code" href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a>, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        }</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160; </div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160; </div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    <span class="keywordflow">case</span> HardErrorAttach:</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;<span class="comment">         * Save a pointer to and prevent destruction of the</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="comment">         * current queue.  This will give us a queue to return</span></div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;<span class="comment">         * to if journalling is occuring when we tear down the</span></div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;<span class="comment">         * hard error popup.</span></div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a> = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)++;</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160; </div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    <span class="keywordflow">case</span> HardErrorAttachNoQueue:</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160; </div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;<span class="comment">         * Attach the handler to the current desktop.</span></div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        pdesk = <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>;</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a>(NULL, pdesk)) {</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;            Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;<span class="comment">             * Make sure this desktop won&#39;t go away</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == NULL) {</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;                Status = ObReferenceObjectByPointer(pdesk,</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;                                               MAXIMUM_ALLOWED,</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                                               *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>,</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;                                               KernelMode);</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;                <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;                    pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> = pdesk;</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;                    pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;                }</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == pdesk) {</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;                <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;HardErrorControl: pti-&gt;pdeskClient != NULL&quot;</span>);</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;            }</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        }</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160; </div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;            <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;HardErrorControl: HardErrorAttachNoQueue failed:%#lx&quot;</span>, Status);</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;            <span class="keywordflow">if</span> (dwCmd != HardErrorAttachNoQueue) {</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a> = NULL;</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;                <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;                (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)--;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;            }</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;        }</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160; </div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160; </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="keywordflow">case</span> HardErrorDetach:</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160; </div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;<span class="comment">         * xxxSwitchDesktop may have sent WM_QUIT to the msgbox, so</span></div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;<span class="comment">         * ensure that the quit flag is reset.</span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> = 0;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160; </div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;<span class="comment">         * We will reset the hard-error queue to the pre-allocated</span></div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;<span class="comment">         * one so if we end up looping back (i.e. from a desktop</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;<span class="comment">         * switch), we will have a valid queue in case the desktop</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;<span class="comment">         * was deleted.</span></div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;        (<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)--;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160; </div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>) {</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> == 0);</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            <a class="code" href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a>(NULL, <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>);</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>++;</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            <a class="code" href="a03290.html#af3b07178c2d5c967a8b5656b3ebcab5e">AttachToQueue</a>(pti, <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">pqAttach</a>, NULL, FALSE);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;        }</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160; </div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;<span class="comment">         * Fall through.</span></div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160; </div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    <span class="keywordflow">case</span> HardErrorDetachNoQueue:</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160; </div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;<span class="comment">         * Process any remaining messages</span></div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;        <span class="keywordflow">while</span> (xxxPeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE | PM_NOYIELD))</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;            <a class="code" href="a03290.html#a389031a6d28f2691dd911f121ef30e94">xxxDispatchMessage</a>(&amp;msg);</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160; </div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;<span class="comment">         * Detach the handler from the desktop and return</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="comment">         * status to indicate if a switch has occured.</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;        pdeskRestore = NULL;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;        <span class="keywordflow">if</span> ((hdeskRestore == NULL)</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;                || NT_SUCCESS(<a class="code" href="a00899.html#a39b12063444a7e1bc0feabd001efd223">ValidateHdesk</a>(hdeskRestore, 0, &amp;pdeskRestore))) {</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160; </div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;            pdesk = pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>;</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;            <a class="code" href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a>(hdeskRestore, pdeskRestore);</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;            <span class="keywordflow">if</span> (pdeskRestore != NULL) {</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;                ObDereferenceObject(pdeskRestore);</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;            }</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160; </div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;<span class="comment">             * Force FALSE return</span></div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;            pdesk = <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;        }</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160; </div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;<span class="comment">         * Don&#39;t need to hold this desktop any longer</span></div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> != NULL) {</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a> &gt; 0);</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;            <span class="keywordflow">if</span> (--pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a> == 0) {</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;                ObDereferenceObject(pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a>);</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;                pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> = NULL;</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;            }</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;HardErrorControl: pti-&gt;pdeskClient == NULL&quot;</span>);</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;        }</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160; </div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;        <span class="keywordflow">return</span> pdesk != <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>;</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;    }</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00656_source.html#l02901">_SetThreadDesktop()</a>, <a class="el" href="a00824_source.html#l01399">AllocQueue()</a>, <a class="el" href="a03290_source.html#l05493">AttachToQueue()</a>, <a class="el" href="a00899_source.html#l02278">tagTHREADINFO::cDeskClient</a>, <a class="el" href="a00899_source.html#l02190">tagQ::cLockCount</a>, <a class="el" href="a00899_source.html#l02306">tagTHREADINFO::cQuit</a>, <a class="el" href="a00899_source.html#l02189">tagQ::cThreads</a>, <a class="el" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>, <a class="el" href="a03257_source.html#l00167">gHardErrorHandler</a>, <a class="el" href="a03257_source.html#l00187">grpdeskRitInput</a>, <a class="el" href="a00899_source.html#l02317">tagTHREADINFO::pdeskClient</a>, <a class="el" href="a00899_source.html#l02273">tagTHREADINFO::pq</a>, <a class="el" href="a00899_source.html#l02516">tagHARDERRORHANDLER::pqAttach</a>, <a class="el" href="a00899_source.html#l02515">tagHARDERRORHANDLER::pti</a>, <a class="el" href="a00263_source.html#l00526">PtiCurrent()</a>, <a class="el" href="a00371_source.html#l00028">RIP_ERROR</a>, <a class="el" href="a00371_source.html#l00030">RIP_VERBOSE</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00119">RIPERR0</a>, <a class="el" href="a00371_source.html#l00131">RIPMSG0</a>, <a class="el" href="a00371_source.html#l00132">RIPMSG1</a>, <a class="el" href="a00899_source.html#l02288">tagTHREADINFO::rpdesk</a>, <a class="el" href="a00950_source.html#l00117">UserAssert</a>, <a class="el" href="a00902_source.html#l00088">ValidateHdesk()</a> , 以及 <a class="el" href="a03290_source.html#l00702">xxxDispatchMessage()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l00302">NtUserHardErrorControl()</a>.</p>

</div>
</div>
<a id="aedc29edf0e324a74e237f3203685bb92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aedc29edf0e324a74e237f3203685bb92">&#9670;&nbsp;</a></span>RestoreClipRgn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RestoreClipRgn </td>
          <td>(</td>
          <td class="paramtype">HDC&#160;</td>
          <td class="paramname"><em>hdc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HRGN&#160;</td>
          <td class="paramname"><em>hrgnRestore</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00076">76</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="comment">// We need to delete this region once we&#39;re done, since SelectClipRgn()</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="comment">// makes a copy of the selected in region.</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    GreExtSelectClipRgn(hdc, hrgnRestore, RGN_COPY);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">if</span> (hrgnRestore)</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        GreDeleteObject(hrgnRestore);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae14a3eceb7409023940af5be90761a68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae14a3eceb7409023940af5be90761a68">&#9670;&nbsp;</a></span>SaveClipRgn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HRGN SaveClipRgn </td>
          <td>(</td>
          <td class="paramtype">HDC&#160;</td>
          <td class="paramname"><em>hdc</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00046">46</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    HRGN hrgnSave;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    POINT pt;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="comment">// We need to create a new region, since GetClipRgn() returns the real</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="comment">// thing.  Note that NULL means no clipping region, so it&#39;s cool to</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="comment">// select that back in when we&#39;re done.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    hrgnSave = GreCreateRectRgn(0, 0, SYSMET(CXSCREEN), SYSMET(CYSCREEN));</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordflow">if</span> (hrgnSave != NULL) {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        GreGetRandomRgn(hdc, hrgnSave, 1);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="comment">// Now, change this to device coords so we can restore it later.</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="comment">// SelectClipRgn() expects region in device coords.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        GreGetDCOrg(hdc, &amp;pt);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        GreOffsetRgn(hrgnSave, -pt.x, -pt.y);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordflow">return</span> hrgnSave;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ac2c47e39bdf2dc77fcb12369b78b5271"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2c47e39bdf2dc77fcb12369b78b5271">&#9670;&nbsp;</a></span>SetWindowState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SetWindowState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>&#160;</td>
          <td class="paramname"><em>dwFlags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00025">25</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;{</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    SetWF(pwnd, dwFlags);</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a9654ab2c4ceb1fdd5cae23a67e88f0cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9654ab2c4ceb1fdd5cae23a67e88f0cd">&#9670;&nbsp;</a></span>xxxGetControlBrush()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HBRUSH xxxGetControlBrush </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HDC&#160;</td>
          <td class="paramname"><em>hdc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00208">208</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;{</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dw;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndSend;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndSend;</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <a class="code" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a>(pwnd);</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160; </div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">if</span> ((pwndSend = (TestwndPopup(pwnd) ? pwnd-&gt;<a class="code" href="a02581.html#a9e4b9545017c505ebd9b8808bd470ab9">spwndOwner</a> : pwnd-&gt;<a class="code" href="a02581.html#a6053af0b243b6737640988eb63081de3">spwndParent</a>))</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;         == NULL)</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        pwndSend = pwnd;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160; </div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <a class="code" href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a>(pwndSend, &amp;tlpwndSend);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="comment">     * Last parameter changes the message into a ctlcolor id.</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    dw = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)<a class="code" href="a03641.html#a4eefb8731d329797cc990e68b5cd02ba">xxxGetControlColor</a>(pwndSend, pwnd, hdc, message);</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    ThreadUnlock(&amp;tlpwndSend);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160; </div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keywordflow">return</span> (HBRUSH)dw;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock()</a>, <a class="el" href="a00563_source.html#l00175">DWORD</a>, <a class="el" href="a00365_source.html#l01394">tagWND::spwndOwner</a>, <a class="el" href="a00365_source.html#l01392">tagWND::spwndParent</a>, <a class="el" href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock()</a> , 以及 <a class="el" href="a03641_source.html#l00160">xxxGetControlColor()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l03752">NtUserGetControlBrush()</a> , 以及 <a class="el" href="a00833_source.html#l00384">xxxGetColorObjects()</a>.</p>

</div>
</div>
<a id="a4eefb8731d329797cc990e68b5cd02ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4eefb8731d329797cc990e68b5cd02ba">&#9670;&nbsp;</a></span>xxxGetControlColor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HBRUSH xxxGetControlColor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwndParent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00365.html#a1a2ef1c363aa0787a8f8a7dde2a34aaf">PWND</a>&#160;</td>
          <td class="paramname"><em>pwndCtl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HDC&#160;</td>
          <td class="paramname"><em>hdc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>&#160;</td>
          <td class="paramname"><em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="a03641_source.html">kernel/random.c</a> 第 <a class="el" href="a03641_source.html#l00160">160</a> 行定义.</p>
<div class="fragment"><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;{</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    HBRUSH hbrush;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">     * If we&#39;re sending to a window of another thread, don&#39;t send this message</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment">     * but instead call DefWindowProc().  New rule about the CTLCOLOR messages.</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment">     * Need to do this so that we don&#39;t send an hdc owned by one thread to</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="comment">     * another thread.  It is also a harmless change.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keywordflow">if</span> (PpiCurrent() != GETPTI(pwndParent)-&gt;ppi) {</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <span class="keywordflow">return</span> (HBRUSH)<a class="code" href="a00671.html#af0a7cefc146c51b12208e692b0f67960">xxxDefWindowProc</a>(pwndParent, message, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)hdc, (LONG)HW(pwndCtl));</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    }</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    hbrush = (HBRUSH)<a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndParent, message, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)hdc, (LONG)HW(pwndCtl));</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">     * If the brush returned from the parent is invalid, get a valid brush from</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment">     * xxxDefWindowProc.</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">if</span> ((hbrush == 0) || !GreValidateServerHandle(hbrush, BRUSH_TYPE)) {</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="keywordflow">if</span> (hbrush != 0)</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;                    <span class="stringliteral">&quot;Invalid HBRUSH from WM_CTLCOLOR*** msg %lX brush %lX&quot;</span>, message, hbrush);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        hbrush = (HBRUSH)<a class="code" href="a00671.html#af0a7cefc146c51b12208e692b0f67960">xxxDefWindowProc</a>(pwndParent, message,</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)hdc, (LONG)pwndCtl);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    }</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">return</span> hbrush;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">引用了 <a class="el" href="a00563_source.html#l00175">DWORD</a>, <a class="el" href="a00371_source.html#l00029">RIP_WARNING</a>, <a class="el" href="a00371_source.html#l00133">RIPMSG2</a>, <a class="el" href="a00671_source.html#l01146">xxxDefWindowProc()</a> , 以及 <a class="el" href="a00842_source.html#l00613">xxxSendMessage()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="a03614_source.html#l03775">NtUserGetControlColor()</a>, <a class="el" href="a03641_source.html#l00208">xxxGetControlBrush()</a> , 以及 <a class="el" href="a00812_source.html#l00055">xxxPaintRect()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa00371_html_a01c4659626880ba56745765a3580a36b"><div class="ttname"><a href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a></div><div class="ttdeci">#define RIPMSG0(flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00131">winerrp.h:131</a></div></div>
<div class="ttc" id="aa02869_html_a63df655cf92843da82e0c872b65baef1"><div class="ttname"><a href="a02869.html#a63df655cf92843da82e0c872b65baef1">tagQ::cThreads</a></div><div class="ttdeci">USHORT cThreads</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02189">userk.h:2189</a></div></div>
<div class="ttc" id="aa02917_html_a4b6fd29dd2c6801509612e223afe5ec7"><div class="ttname"><a href="a02917.html#a4b6fd29dd2c6801509612e223afe5ec7">tagHARDERRORHANDLER::pqAttach</a></div><div class="ttdeci">PQ pqAttach</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02516">userk.h:2516</a></div></div>
<div class="ttc" id="aa03290_html_af3b07178c2d5c967a8b5656b3ebcab5e"><div class="ttname"><a href="a03290.html#af3b07178c2d5c967a8b5656b3ebcab5e">AttachToQueue</a></div><div class="ttdeci">void AttachToQueue(PTHREADINFO pti, PQ pqAttach, PQ pqJournal, BOOL fJoiningForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05493">kernel/input.c:5493</a></div></div>
<div class="ttc" id="aa02581_html_a9e4b9545017c505ebd9b8808bd470ab9"><div class="ttname"><a href="a02581.html#a9e4b9545017c505ebd9b8808bd470ab9">tagWND::spwndOwner</a></div><div class="ttdeci">struct tagWND * spwndOwner</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01394">user.h:1394</a></div></div>
<div class="ttc" id="aa00899_html_a6b562f476cdc12794cf052fff8d41096"><div class="ttname"><a href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a></div><div class="ttdeci">POBJECT_TYPE * ExDesktopObjectType</div></div>
<div class="ttc" id="aa03290_html_a389031a6d28f2691dd911f121ef30e94"><div class="ttname"><a href="a03290.html#a389031a6d28f2691dd911f121ef30e94">xxxDispatchMessage</a></div><div class="ttdeci">LONG xxxDispatchMessage(LPMSG pmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00702">kernel/input.c:702</a></div></div>
<div class="ttc" id="aa00671_html_af0a7cefc146c51b12208e692b0f67960"><div class="ttname"><a href="a00671.html#af0a7cefc146c51b12208e692b0f67960">xxxDefWindowProc</a></div><div class="ttdeci">LONG xxxDefWindowProc(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00671_source.html#l01146">dwp.c:1146</a></div></div>
<div class="ttc" id="aa02801_html"><div class="ttname"><a href="a02801.html">tagDESKTOP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01703">userk.h:1703</a></div></div>
<div class="ttc" id="aa00371_html_ad6b24a3d61abdc148c8751b5c5add686"><div class="ttname"><a href="a00371.html#ad6b24a3d61abdc148c8751b5c5add686">RIP_VERBOSE</a></div><div class="ttdeci">#define RIP_VERBOSE</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00030">winerrp.h:30</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa00371_html_afa5f32de88404289ec03cd2c0e61e94f"><div class="ttname"><a href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a></div><div class="ttdeci">#define RIP_ERROR</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00028">winerrp.h:28</a></div></div>
<div class="ttc" id="aa00371_html_a31aafffb49dfe98bdc749c9b35c90162"><div class="ttname"><a href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a></div><div class="ttdeci">#define RIPMSG1(flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00132">winerrp.h:132</a></div></div>
<div class="ttc" id="aa00842_html_a69cf2e14dcefd941469ad5126e40f79a"><div class="ttname"><a href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a></div><div class="ttdeci">LONG xxxSendMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l00613">sendmsg.c:613</a></div></div>
<div class="ttc" id="aa00257_html_a8315d2c807ba18ba9e528c40614b6173"><div class="ttname"><a href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a></div><div class="ttdeci">PTHREADINFO PtiCurrent(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00263_source.html#l00526">winmgrc.c:526</a></div></div>
<div class="ttc" id="aa02889_html_ad823849cc4fb49252b4941b02841a65f"><div class="ttname"><a href="a02889.html#ad823849cc4fb49252b4941b02841a65f">tagTHREADINFO::pdeskClient</a></div><div class="ttdeci">PDESKTOP pdeskClient</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02317">userk.h:2317</a></div></div>
<div class="ttc" id="aa02889_html_a0bbd3e277e986d4b745d195215ff7e05"><div class="ttname"><a href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">tagTHREADINFO::cDeskClient</a></div><div class="ttdeci">USHORT cDeskClient</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02278">userk.h:2278</a></div></div>
<div class="ttc" id="aa00371_html_ae61d954062a9ece52e350e54cad9a23d"><div class="ttname"><a href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a></div><div class="ttdeci">#define RIPERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00119">winerrp.h:119</a></div></div>
<div class="ttc" id="aa00899_html_abfae1dfb48db23dcea4494f7990ad6a6"><div class="ttname"><a href="a00899.html#abfae1dfb48db23dcea4494f7990ad6a6">ThreadLock</a></div><div class="ttdeci">VOID ThreadLock(PVOID pobj, PTL ptl)</div></div>
<div class="ttc" id="aa00365_html_ac6d261d53f1b8bdcd4467f5bc1072066"><div class="ttname"><a href="a00365.html#ac6d261d53f1b8bdcd4467f5bc1072066">_IsChild</a></div><div class="ttdeci">BOOL _IsChild(PWND pwndParent, PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a03752_source.html#l00658">rtl/wow.c:658</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa00824_html_a44b46f3a89833f8c52a823637e5f5021"><div class="ttname"><a href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a></div><div class="ttdeci">PQ AllocQueue(PTHREADINFO ptiKeyState, PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01399">queue.c:1399</a></div></div>
<div class="ttc" id="aa01881_html"><div class="ttname"><a href="a01881.html">_TL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00257_source.html#l00347">usercli.h:347</a></div></div>
<div class="ttc" id="aa02581_html"><div class="ttname"><a href="a02581.html">tagWND</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01388">user.h:1388</a></div></div>
<div class="ttc" id="aa02917_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">tagHARDERRORHANDLER::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02515">userk.h:2515</a></div></div>
<div class="ttc" id="aa02581_html_a6053af0b243b6737640988eb63081de3"><div class="ttname"><a href="a02581.html#a6053af0b243b6737640988eb63081de3">tagWND::spwndParent</a></div><div class="ttdeci">struct tagWND * spwndParent</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01392">user.h:1392</a></div></div>
<div class="ttc" id="aa00371_html_a41f433389f20db57f042022a662e96de"><div class="ttname"><a href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a></div><div class="ttdeci">#define RIP_WARNING</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00029">winerrp.h:29</a></div></div>
<div class="ttc" id="aa02869_html_aeb913440d6660cc91daeba2052f18f1f"><div class="ttname"><a href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">tagQ::cLockCount</a></div><div class="ttdeci">USHORT cLockCount</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02190">userk.h:2190</a></div></div>
<div class="ttc" id="aa00656_html_a9612118d196f921acc52dcedded646c8"><div class="ttname"><a href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a></div><div class="ttdeci">BOOL _SetThreadDesktop(HDESK hdesk, PDESKTOP pdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02901">desktop.c:2901</a></div></div>
<div class="ttc" id="aa02889_html_abb1184e0c5805b5ad89b79dcc2bd17c8"><div class="ttname"><a href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">tagTHREADINFO::rpdesk</a></div><div class="ttdeci">PDESKTOP rpdesk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02288">userk.h:2288</a></div></div>
<div class="ttc" id="aa02889_html_aea8fcdf7513cfa8972ff27524296079b"><div class="ttname"><a href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">tagTHREADINFO::pq</a></div><div class="ttdeci">struct tagQ * pq</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02273">userk.h:2273</a></div></div>
<div class="ttc" id="aa03257_html_ab81554f3b7171b954e0f03e8d4202a38"><div class="ttname"><a href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a></div><div class="ttdeci">HARDERRORHANDLER gHardErrorHandler</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00167">kernel/globals.c:167</a></div></div>
<div class="ttc" id="aa03641_html_a4eefb8731d329797cc990e68b5cd02ba"><div class="ttname"><a href="a03641.html#a4eefb8731d329797cc990e68b5cd02ba">xxxGetControlColor</a></div><div class="ttdeci">HBRUSH xxxGetControlColor(PWND pwndParent, PWND pwndCtl, HDC hdc, UINT message)</div><div class="ttdef"><b>Definition:</b> <a href="a03641_source.html#l00160">kernel/random.c:160</a></div></div>
<div class="ttc" id="aa00899_html_a70b09c3e2b495630f4205d34be505afb"><div class="ttname"><a href="a00899.html#a70b09c3e2b495630f4205d34be505afb">CheckLock</a></div><div class="ttdeci">VOID CheckLock(PVOID pobj)</div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00371_html_a906cb0845450a5d5422ce513ecd8a32f"><div class="ttname"><a href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a></div><div class="ttdeci">#define RIPMSG2(flags, szFmt, p1, p2)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00133">winerrp.h:133</a></div></div>
<div class="ttc" id="aa03257_html_a326757fcfe334f2ffd59d64d4645d37a"><div class="ttname"><a href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a></div><div class="ttdeci">PDESKTOP grpdeskRitInput</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00187">kernel/globals.c:187</a></div></div>
<div class="ttc" id="aa02889_html_a09679d30cfd8c200ad9b8352eb155126"><div class="ttname"><a href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">tagTHREADINFO::cQuit</a></div><div class="ttdeci">int cQuit</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02306">userk.h:2306</a></div></div>
<div class="ttc" id="aa00899_html_a39b12063444a7e1bc0feabd001efd223"><div class="ttname"><a href="a00899.html#a39b12063444a7e1bc0feabd001efd223">ValidateHdesk</a></div><div class="ttdeci">NTSTATUS ValidateHdesk(HDESK hdesk, ACCESS_MASK amDesired, PDESKTOP *ppdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00902_source.html#l00088">validate.c:88</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a03641.html">random.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
